home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 3 / Info_Mac_1994-01.iso / Development / Source / Shutdown FX 1.3 Source / Shutdown FX ƒ / sfx wipes ƒ / Four corner wipe.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-14  |  2.3 KB  |  74 lines  |  [TEXT/KAHL]

  1. /**********************************************************************\
  2.  
  3. File:        Four corner wipe.c
  4.  
  5. Purpose:    This module handles clearing the screen in a funky
  6.             manner.  See the comments below for more details.
  7.             
  8.  
  9. Shutdown FX -=- graphic effects on shutdown
  10. Copyright (C) 1993 Mark Pilgrim & Dave Blumenthal
  11.  
  12. This program is free software; you can redistribute it and/or modify
  13. it under the terms of the GNU General Public License as published by
  14. the Free Software Foundation; either version 2 of the License, or
  15. (at your option) any later version.
  16.  
  17. This program is distributed in the hope that it will be useful,
  18. but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  20. GNU General Public License for more details.
  21.  
  22. You should have received a copy of the GNU General Public License
  23. along with this program in a file named "GNU General Public License".
  24. If not, write to the Free Software Foundation, 675 Mass Ave,
  25. Cambridge, MA 02139, USA.
  26.  
  27. \**********************************************************************/
  28.  
  29. #include "msg timing.h"
  30.  
  31. #define VBarGap 5
  32. #define HBarGap (VBarGap*height/width)
  33. #define CorrectTime 1
  34.  
  35. void FourCorner(Pattern *thePattern, int width, int height);
  36.  
  37. /* Take 4 bars, two on each axis, and move them towards different corners.
  38.    This means lots of overlap copying, but the timing masks it and Quickdraw
  39.    may even take care of some of it. (?) */
  40.  
  41. void FourCorner(Pattern *thePattern, int width, int height)
  42. {
  43.     Rect        vsource1,hsource1,vsource2,hsource2;
  44.     int            vbar,hbar,cx,cy;
  45.     
  46.     vbar=VBarGap;
  47.     hbar=HBarGap;
  48.     cx = width/2;
  49.     cy = height/2;
  50.     vsource1.top=vsource2.top=hsource2.left=hsource1.left=0;    /* these  */
  51.     vsource1.bottom=vsource2.bottom=height;                        /* never  */
  52.     hsource1.right=hsource2.right=width;                        /* change */
  53.     
  54.     while (vbar<cx+VBarGap)
  55.     {
  56.         StartTiming();
  57.         vsource1.left=cx-vbar;
  58.         vsource1.right=vsource1.left+VBarGap;
  59.         vsource2.right=cx+vbar;
  60.         vsource2.left=vsource2.right-VBarGap;
  61.         hsource1.top=cy-hbar;
  62.         hsource1.bottom=hsource1.top+HBarGap;
  63.         hsource2.bottom=cy+hbar;
  64.         hsource2.top=hsource2.bottom-HBarGap;
  65.         FillRect(&vsource1, *thePattern);
  66.         FillRect(&hsource1, *thePattern);
  67.         FillRect(&vsource2, *thePattern);
  68.         FillRect(&hsource2, *thePattern);
  69.         vbar+=VBarGap;
  70.         hbar+=HBarGap;
  71.         TimeCorrection(CorrectTime);
  72.     }
  73. }
  74.